<template>
    <div class="mui-numbox" data-numbox-min='1'>
        <button class="mui-btn mui-btn-numbox-minus" type="button">-</button>
        <input @change="countChanging" readonly ref="count" id="test" class="mui-input-numbox" type="number" :value='count' />
        <button class="mui-btn mui-btn-numbox-plus" type="button">+</button>
    </div>
</template>
<script>
import mui from '../../lib/mui/js/mui.js'
export default {
    methods:{
        countChanging:function () {
            this.$store.commit('goodsUpdating',{count:this.$refs.count.value,id:this.id});
            // var list = this.$store.getters.getAllResult.res_sel;
            // list.forEach(item=>{
            //     item = parseInt(item);
            //     if(item == (parseInt(this.id))){
            //         this.$emit('getresult');
            //     }
            // });
        }  
    },
    mounted:function () {
        mui('.mui-numbox').numbox();
    },
    props:['count','id']
}
</script>
<style lang="scss" scoped>
.mui-numbox{
    width: 110px!important;
}
</style>